import request from '@/utils/request'

// fix: 正式
const systemApi = {
  user: '/api/sysusers/getUserList',
  setUser: '/api/sysusers/Post_SYS_USERS',
  queryUserName: '/api/sysusers/judgeLoginName',
  getUserInfo: 'api/sysusers/getUsersByID',
  resetPassword: 'api/sysusers/ResetPassword',
  department: '/api/sys_department/getSys_DepartmentList',
  setDepartment: '/api/sys_department/Post_SYS_Department',
  queryDepartmentName: '/api/sys_department/judgeDeptName',
  getDepartmentInfo: '/api/sys_department/getSys_DepartmentByID',
  role: '/api/sys_role/getSys_RoleList',
  setRole: '/api/sys_role/Post_SYS_Role',
  queryRoleName: '/api/sys_role/judgeRoleName',
  getRoleInfo: '/api/sys_role/getSys_RoleByID',
  getRoleTree: '/api/sysobject/getAddRoleDropModule',
  menu: '/api/sys_module/getSys_ModuleList',
  setMenu: '/api/sys_module/Post_SYS_MODULE',
  getMenuInfo: '/api/sys_module/getSys_ModuleByID',
  verificationTitle: '/api/sys_module/judgeModuleKeyName',
  parameter: '/system/parameter',
  sms: '/system/sms',
  access: '/system/access',
  operation: '/system/operation'
}

export function getUserList (parameter) {
  return request({
    url: systemApi.user,
    method: 'get',
    params: parameter
  })
}

export function getUserName (parameter) {
  return request({
    url: systemApi.queryUserName,
    method: 'get',
    params: parameter
  })
}

export function getUserInfo (parameter) {
  return request({
    url: systemApi.getUserInfo,
    method: 'get',
    params: parameter
  })
}

export function resetPassword (parameter) {
  return request({
    url: systemApi.resetPassword,
    method: 'get',
    params: parameter
  })
}

export function setUsers (parameter) {
  return request({
    url: systemApi.setUser,
    method: 'post',
    data: parameter
  })
}

export function getDepartmentList (parameter) {
  return request({
    url: systemApi.department,
    method: 'get',
    params: parameter
  })
}

export function setDepartments (parameter) {
  return request({
    url: systemApi.setDepartment,
    method: 'post',
    data: parameter
  })
}

export function queryDepartmentNames (parameter) {
  return request({
    url: systemApi.queryDepartmentName,
    method: 'get',
    params: parameter
  })
}

export function getDepartmentInfos (parameter) {
  return request({
    url: systemApi.getDepartmentInfo,
    method: 'get',
    params: parameter
  })
}

export function getRoleList (parameter) {
  return request({
    url: systemApi.role,
    method: 'get',
    params: parameter
  })
}

export function getRoleInfo (parameter) {
  return request({
    url: systemApi.getRoleInfo,
    method: 'get',
    params: parameter
  })
}

export function getRoleTrees (parameter) {
  return request({
    url: systemApi.getRoleTree,
    method: 'get',
    params: parameter
  })
}

export function queryRoleNames (parameter) {
  return request({
    url: systemApi.queryRoleName,
    method: 'get',
    params: parameter
  })
}

export function setRoles (parameter) {
  return request({
    url: systemApi.setRole,
    method: 'post',
    data: parameter
  })
}

export function getMenuList (parameter) {
  return request({
    url: systemApi.menu,
    method: 'get',
    params: parameter
  })
}

export function getMenuInfo (parameter) {
  return request({
    url: systemApi.getMenuInfo,
    method: 'get',
    params: parameter
  })
}

export function verificationTitle (parameter) {
  return request({
    url: systemApi.verificationTitle,
    method: 'get',
    params: parameter
  })
}

export function setMenus (parameter) {
  return request({
    url: systemApi.setMenu,
    method: 'post',
    data: parameter
  })
}

export function getParameterList (parameter) {
  return request({
    url: systemApi.parameter,
    method: 'get',
    params: parameter
  })
}

export function getSmsList (parameter) {
  return request({
    url: systemApi.sms,
    method: 'get',
    params: parameter
  })
}

export function geAccessList (parameter) {
  return request({
    url: systemApi.access,
    method: 'get',
    params: parameter
  })
}

export function getOperationList (parameter) {
  return request({
    url: systemApi.operation,
    method: 'get',
    params: parameter
  })
}
